import { View } from "../../../../../mvc/core/View";
import { ObjCreate } from "../../../common/ObjCreate";
import { LoaderHelp } from "../../../../../common/display/LoaderHelp";
import { ResFileConst } from "../../../../resource/ResFileConst";
import { Cache } from "../../../../cache/Cache";
import { GlobalClass } from "../../../../../../com/mui/core/GlobalClass";
import { Log } from "../../../../../../com/gengine/debug/Log";
import { ObjectPool } from "../../../../../../com/gengine/utils/pools/ObjectPool";
import { LineBox } from "../../../guide/LineBox";
type int = number;
//class TigerMachineItem
    
    export  class TigerMachineItem extends View
    {
        constructor()
        {
            super();
            this.initView();
            return;
        }

        public get attribute(): int
        {
            return this._attribute;
        }

        /* internal  */initView(): void
        {
            this._bitmap = ObjCreate.createGBitmap("", 0, 0, this);
            LoaderHelp.addResCallBack(ResFileConst.fashionFlyWing, this.onLoadBmResource);
            return;
        }

        /* internal  */onLoadBmResource(): void
        {
            this._load = true;
            if (this._attribute > 0) 
            {
                this.setData(this._attribute);
            }
            return;
        }

        public setData(arg1: int): void
        {
            this._attribute = arg1;
            if (Cache.instance.wardrobe.FlyWingAttArr.indexOf(this._attribute) >= 0 && this._load) 
            {
                this._bitmap.bitmapData = GlobalClass.getBitmapData("FashionBoxFlyWingAtt_" + arg1);
            }
            else 
            {
                Log.system("老虎机图片显示att" + "att");
            }
            return;
        }

        /* internal  */setTempPicNameForTest(arg1: int): int
        {
            if (arg1 == 8 || arg1 == 9) 
            {
                return 89;
            }
            return arg1;
        }

        /* internal  */showLightMask(): void
        {
            if (!this._lightMask) 
            {
                this._lightMask = ObjectPool.getObject(LightMask);
                this._lightMask.transform.matrix = new Object /* flash.geom.Matrix */();
                this._lightMask.x = -2;
                this._lightMask.y = -2;
                this._lightMask.scaleX = 1.8;
                this._lightMask.scaleY = 1.8;
                this.addChild(this._lightMask);
            }
            return;
        }

        /* internal  */hideLightMask(): void
        {
            if (this._lightMask) 
            {
                if (this._lightMask.parent) 
                {
                    this._lightMask.parent.removeChild(this._lightMask);
                }
                this._lightMask.x = -2;
                this._lightMask.y = -2;
                this._lightMask.width = 62;
                this._lightMask.height = 60;
                ObjectPool.disposeObject(this._lightMask);
                this._lightMask = null;
            }
            return;
        }

        public shineResult(arg1: Boolean): void
        {
            if (arg1) 
            {
                this.showLightMask();
            }
            else 
            {
                this.hideLightMask();
            }
            return;
        }

        /* internal */ /* var */_bitmap: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_attribute: int;

        /* internal */ /* var */_load: Boolean;

        /* internal */ /* var */_lightMask: LightMask;

        /* internal */ /* var */_lineBox: LineBox;

        public static /* var */DEFAULT_WIDTH: int=62;

        public static /* var */DEFAULT_HEIGHT: int=60;
    }

            TigerMachineItem.DEFAULT_WIDTH = 62;
            TigerMachineItem.DEFAULT_HEIGHT = 60;
        